#
#  Be sure to run `pod spec lint ios-swift-imbroker.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |spec|

# spec的名字，同podfile中指定依赖的名字一致。
spec.name         = "ios-swift-ad"
# 版本号，同podfile中指定依赖的版本号一致。
spec.version      = "1.0.4.1"
spec.summary      = "广告系统SDK"

# 描述，一般要比summary长度长些，否则pod lint时会有警告。非强制性。
spec.description  = <<-DESC
 包括启动图、弹框、banner、浮层、四种广告类型.
DESC
# 主页地址，一般指向github地址即可
spec.homepage     = "http://gitcode.lietou.com/dev28/framework/ios/ios-swift-ad.git"
# 截图，一般不需要
# spec.screenshots  = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
# 许可证，一般为MIT或BSD 3-clause,默认MIT即可
spec.license      = "MIT"
# 指定许可证的另一种方式
# spec.license      = { :type => "MIT", :file => "FILE_LICENSE" }
# 作者介绍 左边为名字，邮编为联系方式或者主页
spec.author             = { "xuwc" => "xuwc@liepin.com" }
# 指定使用系统平台
# spec.platform     = :ios
# 指定使用系统平台以及系统版本号
spec.platform     = :ios, "8.0"
# 是否采用arc，一般默认为true
spec.requires_arc = true
# 指定经爱哭使用方式，一般swift必须指定该项为true
spec.static_framework = true
# 指定swift版本号
spec.swift_version = '5.0'
# 指定module名字，一般swift使用时必须指定,注意不能使用-，要改为下划线_
spec.module_name   = 'ios_swift_ad'

# 当使用多个平台时，可如下指定，一共就4个平台。ios,osx,watchos,tvos
# spec.ios.deployment_target = "5.0"
# spec.osx.deployment_target = "10.7"
# spec.watchos.deployment_target = "2.0"
# spec.tvos.deployment_target = "9.0"

# 指定核心依赖库，开启后，仅加载指定的子库
# spec.default_subspecs = 'Core', 'UI'

# 下载资源远程仓库路径，tag为版本号，可手动指定，也可与spec版本保持一致。
spec.source       = { :git => "http://gitcode.lietou.com/dev28/framework/ios/ios-swift-ad.git", :tag => "#{spec.version}" }
# 类资源文件，为ios-swift-tools.git根目录算起,一般为这样设置即可
spec.source_files  = "classes/*"
# 非下载的文件集合，一般用于readme.md等无需下载的资源使用
#spec.exclude_files = "classes/Exclude"

# 对外开放的头文件
spec.public_header_files = "classes/ios_swift_ad.h"
# 私有文件，不暴露给外界使用
#spec.private_header_files = "classes/imbroker/*.h"

# 资源文件路径，此资源被直接使用
# spec.resource  = "icon.png"
# spec.resources = "Resources/**/*.png"

# 资源文件指定，会被打包成bundle文件，使用资源时需要指定bundle名字, 一般采用这种
# spec.resource_bundles = {
#     'ios-swift-tools' => ['Resources/**/*]
# }

# spec.preserve_paths = "FilesToSave", "MoreFilesToSave"

# 系统动态库依赖方式
# spec.framework  = "SomeFramework"
# spec.frameworks = "SomeFramework", "AnotherFramework"

# 系统静态库依赖方式
# spec.library   = "iconv"
# spec.libraries = "iconv", "xml2"

# 本地提供的静态库依赖方式
# spec.vendored_libraries = "classes/**/*.a"

# 本地提供的动态库依赖方式
# subspec.ios.vendored_frameworks = "classes/**/*.framework"

# 修改工程配置
# spec.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }

# 依赖其他第三方库
# spec.dependency "JSONKit", "~> 1.4"

# oc与swift混编，提供预编译头文件引用。
# spec.prefix_header_contents = '#import "xxx.h"', '#import <UIKit/UIKit.h>'

# *******
# 将oc文件开放给swift使用，需要在classes类下面创建ios_swift_imbroker.h空文件，否则swift将无法找到该方法
# *******

# 子库创建方式
spec.subspec 'lpadclient' do | lpadclient |

	lpadclient.source_files = 'classes/lpadclient/*.{swift}'

	lpadclient.subspec 'adntity' do |adntity|
		adntity.source_files = 'classes/lpadclient/LPAdEntity/*.{swift}'
	end

	lpadclient.subspec 'adinternal' do |adinternal|
		adinternal.source_files = 'classes/lpadclient/LPAdInternal/*.{swift}'

		adinternal.subspec 'adlogManager' do |adlogManager|
			adlogManager.source_files = 'classes/lpadclient/LPAdInternal/LPAdLogManager/*.{swift}'
		end

		adinternal.subspec 'adproxy' do |adproxy|
			adproxy.source_files = 'classes/lpadclient/LPAdInternal/LPAdProxy/*.{swift}'
		end
	end

	lpadclient.subspec 'adlog' do |adlog|
		adlog.source_files = 'classes/lpadclient/LPAdLog/*.{swift}'
	end

	lpadclient.subspec 'view' do |view|
		view.source_files = 'classes/lpadclient/view/*.{swift}'
	end

	lpadclient.subspec 'adsample' do |adsample|
		adsample.source_files = 'classes/lpadclient/LPAdSample/*.{swift}'
	end

end

spec.frameworks = 'UIKit'
spec.dependency 'ios-swift-tools'
spec.dependency 'ios-swift-base'
spec.dependency 'ios-swift-dbclient'
spec.dependency 'ios-swift-httpclient'
spec.dependency 'SDWebImage'
spec.dependency 'MJExtension'

spec.resource_bundles = {
  'ios-swift-ad' => ['assets/**/*.{png,plist}']
}

end

